package com.leha.forum.lehare.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.leha.forum.lehare.entity.Comment;
import com.baomidou.mybatisplus.extension.service.IService;
import com.leha.forum.lehare.entity.Post;

import java.util.function.Supplier;

/**
* @author Administrator
* @description 针对表【comment】的数据库操作Service
* @createDate 2025-04-15 21:44:28
*/
public interface CommentService extends IService<Comment> {
    default IPage<Comment> getComments(Long postId, Long page, Long size) {
        return this.getComments(postId, page, size, QueryWrapper::new);
    }

    IPage<Comment> getComments(Long postId, Long page, Long size, Supplier<QueryWrapper<Comment>> queryWrapperSupplier);

    boolean addComment(Long userId, Long postId, Long parentId, String content);
}
